﻿@*<script>
    $(document).ready(function () {
        var id = "";
        $("li a").click(function (event) {
            localStorage.setItem("SelectedNewsId", this.id);
        });
        $('.right-nav li a').removeClass();
        id = localStorage.getItem("SelectedNewsId");
        $(('#' + id)).addClass('active');
    });
</script>*@

@*<ul class="right-nav">
    <li class="rn-title">News Updates</li>
    <li><a id="news1" href="/NewsUpdates/Index"><span>23 June, 2014</span> - Donec volutpat dolor id urna pulvinar pharetra.</a></li>
    <li><a id="news2" href="/NewsUpdates/Index"><span>22 June, 2014</span> - Donec volutpat dolor pulvinar pharetra.</a></li>
    <li><a id="news3" href="/NewsUpdates/Index"><span>21 June, 2014</span> - Donec volutpat dolor.</a></li>
</ul>
<ul class="right-nav">
    <li class="rn-title">Blogs</li>
    <li><a id="news5" href="/Blogs/Index"><span>23 June, 2014</span> - Donec volutpat dolor id urna pulvinar pharetra.</a></li>
    <li><a id="news6" href="/Blogs/Index"><span>22 June, 2014</span> - Donec volutpat dolor pulvinar pharetra.</a></li>
    <li><a id="news7" href="/Blogs/Index"><span>21 June, 2014</span> - Donec volutpat dolor.</a></li>
</ul>*@
<ul class="right-nav">
    <li class="rn-title">News Updates</li>
    <!-- ko foreach: $root.media.SecondaryMedia1-->
    <li><a id="news1" href="/NewsUpdates/Index" data-bind="attr:{href:('../Home/Media?mediaTypeId=2&mediaId='+$data.MediaId)}"><span data-bind="text:$data.Header1"></span>- <span data-bind="text:$data.Header2"></span></a></li>
    <!-- /ko -->
</ul>
<ul class="right-nav">
    <li class="rn-title">Blogs</li>
    <!-- ko foreach: $root.media.SecondaryMedia2-->
    <li><a id="news5" href="/Blogs/Index" data-bind="attr:{href:('../Home/Media?mediaTypeId=3&mediaId='+$data.MediaId)}"><span data-bind="text:$data.Header1"></span>- <span data-bind="text:$data.Header2"></span></a></li>
    <!-- /ko -->
</ul>
<script type="text/javascript">
    var data = [@Html.Raw(Json.Encode(ViewBag.Media))];
    data = data[0];

    function MediaModel(media) {
        self = this;

        self.media = media;
    }
    var viewModel = new MediaModel(data);

    ko.applyBindings(viewModel);
</script>
